<template>
  <div
      :style="itemStyle"
      class="menu-item"
      @click="onClick">
      <slot></slot>
  </div>
</template>

<script>
export default {
  name: "XContextmenuItem",
  props:{
    title:{
      type:String,
      default:""
    },
    clickFn:{
      type:Function,
      default:function () {}
    },
    itemStyle:{
      type:Object,
      default:function (){}
    }
  },
  methods:{
    onClick(){
      this.$emit("onClick")
    }
  }
}
</script>

<style scoped lang="scss">
.menu-item{
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-item:hover{
  background: #F5F7FA;
}
</style>
